home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / SoundComponents.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  16.5 KB  |  634 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        SoundComponents.a
  3. ;
  4. ;    Contains:    Sound Components Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__SOUNDCOMPONENTS__') = 'UNDEFINED' THEN
  21. __SOUNDCOMPONENTS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  30.     include 'Components.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33.  
  34.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  35.     include 'Sound.a'
  36.     ENDIF
  37. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38. ; constants
  39. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  40.  
  41. ;sound component set/get info selectors
  42. siVolume                        EQU        'volu'
  43. siHardwareVolume                EQU        'hvol'
  44. siSpeakerVolume                    EQU        'svol'
  45. siHeadphoneVolume                EQU        'pvol'
  46. siHardwareVolumeSteps            EQU        'hstp'
  47. siHeadphoneVolumeSteps            EQU        'hdst'
  48. siHardwareMute                    EQU        'hmut'
  49. siSpeakerMute                    EQU        'smut'
  50. siHeadphoneMute                    EQU        'pmut'
  51. siRateMultiplier                EQU        'rmul'
  52. siQuality                        EQU        'qual'
  53. ;format types
  54. kOffsetBinary                    EQU        'raw '
  55. kTwosComplement                    EQU        'twos'
  56. kMACE3Compression                EQU        'MAC3'
  57. kMACE6Compression                EQU        'MAC6'
  58.  
  59. ;quality flags
  60. ;use interpolation in rate conversion
  61. kBestQuality                    EQU        (1 << 0)
  62.  
  63. ;useful bit masks
  64. kInputMask                        EQU        $000000FF            ;masks off input bits
  65. kOutputMask                        EQU        $0000FF00            ;masks off output bits
  66. kOutputShift                    EQU        8                    ;amount output bits are shifted
  67. kActionMask                        EQU        $00FF0000            ;masks off action bits
  68. kSoundComponentBits                EQU        $00FFFFFF
  69.  
  70. ;SoundComponentPlaySourceBuffer action flags
  71. kSourcePaused                    EQU        (1 << 0)
  72. kPassThrough                    EQU        (1 << 16)
  73. kNoSoundComponentChain            EQU        (1 << 17)
  74. ;flags for OpenMixerSoundComponent
  75. kNoMixing                        EQU        (1 << 0)            ;don't mix source
  76. kNoSampleRateConversion            EQU        (1 << 1)            ;don't convert sample rate (i.e. 11 kHz -> 22 kHz)
  77. kNoSampleSizeConversion            EQU        (1 << 2)            ;don't convert sample size (i.e. 16 -> 8)
  78. kNoSampleFormatConversion        EQU        (1 << 3)            ;don't convert sample format (i.e. 'twos' -> 'raw ')
  79. kNoChannelConversion            EQU        (1 << 4)            ;don't convert stereo/mono
  80. kNoDecompression                EQU        (1 << 5)            ;don't decompress (i.e. 'MAC3' -> 'raw ')
  81. kNoVolumeConversion                EQU        (1 << 6)            ;don't apply volume
  82. kNoRealtimeProcessing            EQU        (1 << 7)            ;won't run at interrupt time
  83.  
  84. ;Audio Component constants
  85. ;Values for whichChannel parameter
  86. audioAllChannels                EQU        0                    ;All channels (usually interpreted as both left and right)
  87. audioLeftChannel                EQU        1                    ;Left channel
  88. audioRightChannel                EQU        2                    ;Right channel
  89. ;Values for mute parameter
  90. audioUnmuted                    EQU        0                    ;Device is unmuted
  91. audioMuted                        EQU        1                    ;Device is muted
  92. ;Capabilities flags definitions
  93. audioDoesMono                    EQU        (1 << 0)            ;Device supports mono output
  94. audioDoesStereo                    EQU        (1 << 1)            ;Device supports stereo output
  95. audioDoesIndependentChannels    EQU        (1 << 2)            ;Device supports independent software control of each channel
  96.  
  97. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98. ; typedefs
  99. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100. ;ShortFixed consists of an 8 bit, 2's complement integer part in the high byte,
  101. ;with an 8 bit fractional part in the low byte; its range is -128 to 127.99609375
  102. ; typedef short             ShortFixed
  103. ; typedef struct SoundComponentData  SoundComponentData
  104. ; typedef struct SoundComponentData  *SoundComponentDataPtr
  105. SoundComponentData         RECORD    0
  106. flags                     ds.l   1        ; offset: $0 (0)
  107. format                     ds.l   1        ; offset: $4 (4)
  108. numChannels                 ds.w   1        ; offset: $8 (8)
  109. sampleSize                 ds.w   1        ; offset: $A (10)
  110. sampleRate                 ds.l   1        ; offset: $C (12)
  111. sampleCount                 ds.l   1        ; offset: $10 (16)
  112. buffer                     ds.l   1        ; offset: $14 (20)
  113. reserved                 ds.l   1        ; offset: $18 (24)
  114. sizeof                     EQU *            ; size:   $1C (28)
  115.                         ENDR
  116.  
  117. ; typedef struct SoundParamBlock  SoundParamBlock
  118. ; typedef SoundParamBlock     *SoundParamBlockPtr
  119. SoundParamBlock         RECORD    0
  120. recordSize                 ds.l   1        ; offset: $0 (0)        ;size of this record in bytes
  121. desc                     ds     SoundComponentData ; offset: $4 (4) ;description of sound buffer
  122. rateMultiplier             ds.l   1        ; offset: $20 (32)        ;rate multiplier to apply to sound
  123. leftVolume                 ds.w   1        ; offset: $24 (36)        ;volumes to apply to sound
  124. rightVolume                 ds.w   1        ; offset: $26 (38)
  125. quality                     ds.l   1        ; offset: $28 (40)        ;quality to apply to sound
  126. filter                     ds.l   1        ; offset: $2C (44)        ;filter to apply to sound
  127. moreRtn                     ds.l   1        ; offset: $30 (48)        ;routine to call to get more data
  128. completionRtn             ds.l   1        ; offset: $34 (52)        ;routine to call when buffer is complete
  129. refCon                     ds.l   1        ; offset: $38 (56)        ;user refcon
  130. result                     ds.w   1        ; offset: $3C (60)        ;result
  131. sizeof                     EQU *            ; size:   $3E (62)
  132.                         ENDR
  133.  
  134. ; typedef void                 *SoundSource
  135. AudioInfo                 RECORD    0
  136. capabilitiesFlags         ds.l   1        ; offset: $0 (0)        ;Describes device capabilities
  137. reserved                 ds.l   1        ; offset: $4 (4)        ;Reserved by Apple
  138. numVolumeSteps             ds.w   1        ; offset: $8 (8)        ;Number of significant increments between min and max volume
  139. sizeof                     EQU *            ; size:   $A (10)
  140.                         ENDR
  141.  
  142. ; typedef struct AudioInfo     AudioInfo
  143. ; typedef AudioInfo         *AudioInfoPtr
  144. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  145. ; functions for sound components
  146. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  147. ;Sound Component dispatch selectors
  148.  
  149. ;these calls cannot be delegated
  150. kSoundComponentInitOutputDeviceSelect EQU        1
  151. kSoundComponentSetSourceSelect    EQU        2
  152. kSoundComponentGetSourceSelect    EQU        3
  153. kSoundComponentGetSourceDataSelect EQU        4
  154. kSoundComponentSetOutputSelect    EQU        5
  155. kDelegatedSoundComponentSelectors EQU        $0100                ;first selector that can be delegated up the chain
  156. ;these calls can be delegated and have own range
  157. kSoundComponentAddSourceSelect    EQU        kDelegatedSoundComponentSelectors + 1
  158. kSoundComponentRemoveSourceSelect EQU        kDelegatedSoundComponentSelectors + 2
  159. kSoundComponentGetInfoSelect    EQU        kDelegatedSoundComponentSelectors + 3
  160. kSoundComponentSetInfoSelect    EQU        kDelegatedSoundComponentSelectors + 4
  161. kSoundComponentStartSourceSelect EQU        kDelegatedSoundComponentSelectors + 5
  162. kSoundComponentStopSourceSelect    EQU        kDelegatedSoundComponentSelectors + 6
  163. kSoundComponentPauseSourceSelect EQU        kDelegatedSoundComponentSelectors + 7
  164. kSoundComponentPlaySourceBufferSelect EQU        kDelegatedSoundComponentSelectors + 8
  165.  
  166. ;Audio Component selectors
  167. kAudioGetVolumeSelect            EQU        0
  168. kAudioSetVolumeSelect            EQU        1
  169. kAudioGetMuteSelect                EQU        2
  170. kAudioSetMuteSelect                EQU        3
  171. kAudioSetToDefaultsSelect        EQU        4
  172. kAudioGetInfoSelect                EQU        5
  173. kAudioGetBassSelect                EQU        6
  174. kAudioSetBassSelect                EQU        7
  175. kAudioGetTrebleSelect            EQU        8
  176. kAudioSetTrebleSelect            EQU        9
  177. kAudioGetOutputDeviceSelect        EQU        10
  178. kAudioMuteOnEventSelect            EQU        129
  179.  
  180. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  181. ; Sound Manager 3.0 utilities
  182. ;
  183. ; pascal OSErr OpenMixerSoundComponent(SoundComponentDataPtr outputDescription, long outputFlags, ComponentInstance *mixerComponent)
  184. ;
  185.     IF ¬ GENERATINGCFM THEN
  186.         Macro
  187.         _OpenMixerSoundComponent
  188.             dc.w     $203C
  189.             dc.w     $0614
  190.             dc.w     $0018
  191.             dc.w     $A800
  192.         EndM
  193.     ELSE
  194.         IMPORT_CFM_FUNCTION    OpenMixerSoundComponent
  195.     ENDIF
  196.  
  197. ;
  198. ; pascal OSErr CloseMixerSoundComponent(ComponentInstance ci)
  199. ;
  200.     IF ¬ GENERATINGCFM THEN
  201.         Macro
  202.         _CloseMixerSoundComponent
  203.             dc.w     $203C
  204.             dc.w     $0218
  205.             dc.w     $0018
  206.             dc.w     $A800
  207.         EndM
  208.     ELSE
  209.         IMPORT_CFM_FUNCTION    CloseMixerSoundComponent
  210.     ENDIF
  211.  
  212. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  213. ; basic sound component functions
  214. ;
  215. ; pascal ComponentResult SoundComponentInitOutputDevice(ComponentInstance ti, long actions)
  216. ;
  217.     IF ¬ GENERATINGCFM THEN
  218.         Macro
  219.         _SoundComponentInitOutputDevice
  220.             dc.w     $2F3C
  221.             dc.w     $0004
  222.             dc.w     $0001
  223.             moveq    #0,d0
  224.             dc.w     $A82A
  225.         EndM
  226.     ELSE
  227.         IMPORT_CFM_FUNCTION    SoundComponentInitOutputDevice
  228.     ENDIF
  229.  
  230. ;
  231. ; pascal ComponentResult SoundComponentSetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance source)
  232. ;
  233.     IF ¬ GENERATINGCFM THEN
  234.         Macro
  235.         _SoundComponentSetSource
  236.             dc.w     $2F3C
  237.             dc.w     $0008
  238.             dc.w     $0002
  239.             moveq    #0,d0
  240.             dc.w     $A82A
  241.         EndM
  242.     ELSE
  243.         IMPORT_CFM_FUNCTION    SoundComponentSetSource
  244.     ENDIF
  245.  
  246. ;
  247. ; pascal ComponentResult SoundComponentGetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance *source)
  248. ;
  249.     IF ¬ GENERATINGCFM THEN
  250.         Macro
  251.         _SoundComponentGetSource
  252.             dc.w     $2F3C
  253.             dc.w     $0008
  254.             dc.w     $0003
  255.             moveq    #0,d0
  256.             dc.w     $A82A
  257.         EndM
  258.     ELSE
  259.         IMPORT_CFM_FUNCTION    SoundComponentGetSource
  260.     ENDIF
  261.  
  262. ;
  263. ; pascal ComponentResult SoundComponentGetSourceData(ComponentInstance ti, SoundComponentDataPtr *sourceData)
  264. ;
  265.     IF ¬ GENERATINGCFM THEN
  266.         Macro
  267.         _SoundComponentGetSourceData
  268.             dc.w     $2F3C
  269.             dc.w     $0004
  270.             dc.w     $0004
  271.             moveq    #0,d0
  272.             dc.w     $A82A
  273.         EndM
  274.     ELSE
  275.         IMPORT_CFM_FUNCTION    SoundComponentGetSourceData
  276.     ENDIF
  277.  
  278. ;
  279. ; pascal ComponentResult SoundComponentSetOutput(ComponentInstance ti, SoundComponentDataPtr requested, SoundComponentDataPtr *actual)
  280. ;
  281.     IF ¬ GENERATINGCFM THEN
  282.         Macro
  283.         _SoundComponentSetOutput
  284.             dc.w     $2F3C
  285.             dc.w     $0008
  286.             dc.w     $0005
  287.             moveq    #0,d0
  288.             dc.w     $A82A
  289.         EndM
  290.     ELSE
  291.         IMPORT_CFM_FUNCTION    SoundComponentSetOutput
  292.     ENDIF
  293.  
  294. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  295. ; junction methods for the mixer, must be called at non-interrupt level
  296. ;
  297. ; pascal ComponentResult SoundComponentAddSource(ComponentInstance ti, SoundSource *sourceID)
  298. ;
  299.     IF ¬ GENERATINGCFM THEN
  300.         Macro
  301.         _SoundComponentAddSource
  302.             dc.w     $2F3C
  303.             dc.w     $0004
  304.             dc.w     $0101
  305.             moveq    #0,d0
  306.             dc.w     $A82A
  307.         EndM
  308.     ELSE
  309.         IMPORT_CFM_FUNCTION    SoundComponentAddSource
  310.     ENDIF
  311.  
  312. ;
  313. ; pascal ComponentResult SoundComponentRemoveSource(ComponentInstance ti, SoundSource sourceID)
  314. ;
  315.     IF ¬ GENERATINGCFM THEN
  316.         Macro
  317.         _SoundComponentRemoveSource
  318.             dc.w     $2F3C
  319.             dc.w     $0004
  320.             dc.w     $0102
  321.             moveq    #0,d0
  322.             dc.w     $A82A
  323.         EndM
  324.     ELSE
  325.         IMPORT_CFM_FUNCTION    SoundComponentRemoveSource
  326.     ENDIF
  327.  
  328. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  329. ; info methods
  330. ;
  331. ; pascal ComponentResult SoundComponentGetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  332. ;
  333.     IF ¬ GENERATINGCFM THEN
  334.         Macro
  335.         _SoundComponentGetInfo
  336.             dc.w     $2F3C
  337.             dc.w     $000C
  338.             dc.w     $0103
  339.             moveq    #0,d0
  340.             dc.w     $A82A
  341.         EndM
  342.     ELSE
  343.         IMPORT_CFM_FUNCTION    SoundComponentGetInfo
  344.     ENDIF
  345.  
  346. ;
  347. ; pascal ComponentResult SoundComponentSetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  348. ;
  349.     IF ¬ GENERATINGCFM THEN
  350.         Macro
  351.         _SoundComponentSetInfo
  352.             dc.w     $2F3C
  353.             dc.w     $000C
  354.             dc.w     $0104
  355.             moveq    #0,d0
  356.             dc.w     $A82A
  357.         EndM
  358.     ELSE
  359.         IMPORT_CFM_FUNCTION    SoundComponentSetInfo
  360.     ENDIF
  361.  
  362. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  363. ; control methods
  364. ;
  365. ; pascal ComponentResult SoundComponentStartSource(ComponentInstance ti, short count, SoundSource *sources)
  366. ;
  367.     IF ¬ GENERATINGCFM THEN
  368.         Macro
  369.         _SoundComponentStartSource
  370.             dc.w     $2F3C
  371.             dc.w     $0006
  372.             dc.w     $0105
  373.             moveq    #0,d0
  374.             dc.w     $A82A
  375.         EndM
  376.     ELSE
  377.         IMPORT_CFM_FUNCTION    SoundComponentStartSource
  378.     ENDIF
  379.  
  380. ;
  381. ; pascal ComponentResult SoundComponentStopSource(ComponentInstance ti, short count, SoundSource *sources)
  382. ;
  383.     IF ¬ GENERATINGCFM THEN
  384.         Macro
  385.         _SoundComponentStopSource
  386.             dc.w     $2F3C
  387.             dc.w     $0006
  388.             dc.w     $0106
  389.             moveq    #0,d0
  390.             dc.w     $A82A
  391.         EndM
  392.     ELSE
  393.         IMPORT_CFM_FUNCTION    SoundComponentStopSource
  394.     ENDIF
  395.  
  396. ;
  397. ; pascal ComponentResult SoundComponentPauseSource(ComponentInstance ti, short count, SoundSource *sources)
  398. ;
  399.     IF ¬ GENERATINGCFM THEN
  400.         Macro
  401.         _SoundComponentPauseSource
  402.             dc.w     $2F3C
  403.             dc.w     $0006
  404.             dc.w     $0107
  405.             moveq    #0,d0
  406.             dc.w     $A82A
  407.         EndM
  408.     ELSE
  409.         IMPORT_CFM_FUNCTION    SoundComponentPauseSource
  410.     ENDIF
  411.  
  412. ;
  413. ; pascal ComponentResult SoundComponentPlaySourceBuffer(ComponentInstance ti, SoundSource sourceID, SoundParamBlockPtr pb, long actions)
  414. ;
  415.     IF ¬ GENERATINGCFM THEN
  416.         Macro
  417.         _SoundComponentPlaySourceBuffer
  418.             dc.w     $2F3C
  419.             dc.w     $000C
  420.             dc.w     $0108
  421.             moveq    #0,d0
  422.             dc.w     $A82A
  423.         EndM
  424.     ELSE
  425.         IMPORT_CFM_FUNCTION    SoundComponentPlaySourceBuffer
  426.     ENDIF
  427.  
  428. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  429. ; interface for Audio Components
  430. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  431. ;Volume is described as a value between 0 and 1, with 0 indicating minimum
  432. ;  volume and 1 indicating maximum volume; if the device doesn't support
  433. ;  software control of volume, then a value of unimpErr is returned, indicating
  434. ;  that these functions are not supported by the device
  435. ;
  436. ; pascal ComponentResult AudioGetVolume(ComponentInstance ac, short whichChannel, ShortFixed *volume)
  437. ;
  438.     IF ¬ GENERATINGCFM THEN
  439.         Macro
  440.         _AudioGetVolume
  441.             dc.w     $2F3C
  442.             dc.w     $0006
  443.             dc.w     $0000
  444.             moveq    #0,d0
  445.             dc.w     $A82A
  446.         EndM
  447.     ELSE
  448.         IMPORT_CFM_FUNCTION    AudioGetVolume
  449.     ENDIF
  450.  
  451. ;
  452. ; pascal ComponentResult AudioSetVolume(ComponentInstance ac, short whichChannel, ShortFixed volume)
  453. ;
  454.     IF ¬ GENERATINGCFM THEN
  455.         Macro
  456.         _AudioSetVolume
  457.             dc.w     $2F3C
  458.             dc.w     $0004
  459.             dc.w     $0001
  460.             moveq    #0,d0
  461.             dc.w     $A82A
  462.         EndM
  463.     ELSE
  464.         IMPORT_CFM_FUNCTION    AudioSetVolume
  465.     ENDIF
  466.  
  467. ;If the device doesn't support software control of mute, then a value of unimpErr is
  468. ;returned, indicating that these functions are not supported by the device
  469. ;
  470. ; pascal ComponentResult AudioGetMute(ComponentInstance ac, short whichChannel, short *mute)
  471. ;
  472.     IF ¬ GENERATINGCFM THEN
  473.         Macro
  474.         _AudioGetMute
  475.             dc.w     $2F3C
  476.             dc.w     $0006
  477.             dc.w     $0002
  478.             moveq    #0,d0
  479.             dc.w     $A82A
  480.         EndM
  481.     ELSE
  482.         IMPORT_CFM_FUNCTION    AudioGetMute
  483.     ENDIF
  484.  
  485. ;
  486. ; pascal ComponentResult AudioSetMute(ComponentInstance ac, short whichChannel, short mute)
  487. ;
  488.     IF ¬ GENERATINGCFM THEN
  489.         Macro
  490.         _AudioSetMute
  491.             dc.w     $2F3C
  492.             dc.w     $0004
  493.             dc.w     $0003
  494.             moveq    #0,d0
  495.             dc.w     $A82A
  496.         EndM
  497.     ELSE
  498.         IMPORT_CFM_FUNCTION    AudioSetMute
  499.     ENDIF
  500.  
  501. ;AudioSetToDefaults causes the associated device to reset its volume and mute values
  502. ;(and perhaps other characteristics, e.g. attenuation) to "factory default" settings
  503. ;
  504. ; pascal ComponentResult AudioSetToDefaults(ComponentInstance ac)
  505. ;
  506.     IF ¬ GENERATINGCFM THEN
  507.         Macro
  508.         _AudioSetToDefaults
  509.             dc.w     $2F3C
  510.             dc.w     $0000
  511.             dc.w     $0004
  512.             moveq    #0,d0
  513.             dc.w     $A82A
  514.         EndM
  515.     ELSE
  516.         IMPORT_CFM_FUNCTION    AudioSetToDefaults
  517.     ENDIF
  518.  
  519. ;This routine is required; it must be implemented by all audio components
  520. ;
  521. ; pascal ComponentResult AudioGetInfo(ComponentInstance ac, AudioInfoPtr info)
  522. ;
  523.     IF ¬ GENERATINGCFM THEN
  524.         Macro
  525.         _AudioGetInfo
  526.             dc.w     $2F3C
  527.             dc.w     $0004
  528.             dc.w     $0005
  529.             moveq    #0,d0
  530.             dc.w     $A82A
  531.         EndM
  532.     ELSE
  533.         IMPORT_CFM_FUNCTION    AudioGetInfo
  534.     ENDIF
  535.  
  536. ;
  537. ; pascal ComponentResult AudioGetBass(ComponentInstance ac, short whichChannel, short *bass)
  538. ;
  539.     IF ¬ GENERATINGCFM THEN
  540.         Macro
  541.         _AudioGetBass
  542.             dc.w     $2F3C
  543.             dc.w     $0006
  544.             dc.w     $0006
  545.             moveq    #0,d0
  546.             dc.w     $A82A
  547.         EndM
  548.     ELSE
  549.         IMPORT_CFM_FUNCTION    AudioGetBass
  550.     ENDIF
  551.  
  552. ;
  553. ; pascal ComponentResult AudioSetBass(ComponentInstance ac, short whichChannel, short bass)
  554. ;
  555.     IF ¬ GENERATINGCFM THEN
  556.         Macro
  557.         _AudioSetBass
  558.             dc.w     $2F3C
  559.             dc.w     $0004
  560.             dc.w     $0007
  561.             moveq    #0,d0
  562.             dc.w     $A82A
  563.         EndM
  564.     ELSE
  565.         IMPORT_CFM_FUNCTION    AudioSetBass
  566.     ENDIF
  567.  
  568. ;
  569. ; pascal ComponentResult AudioGetTreble(ComponentInstance ac, short whichChannel, short *Treble)
  570. ;
  571.     IF ¬ GENERATINGCFM THEN
  572.         Macro
  573.         _AudioGetTreble
  574.             dc.w     $2F3C
  575.             dc.w     $0006
  576.             dc.w     $0008
  577.             moveq    #0,d0
  578.             dc.w     $A82A
  579.         EndM
  580.     ELSE
  581.         IMPORT_CFM_FUNCTION    AudioGetTreble
  582.     ENDIF
  583.  
  584. ;
  585. ; pascal ComponentResult AudioSetTreble(ComponentInstance ac, short whichChannel, short Treble)
  586. ;
  587.     IF ¬ GENERATINGCFM THEN
  588.         Macro
  589.         _AudioSetTreble
  590.             dc.w     $2F3C
  591.             dc.w     $0004
  592.             dc.w     $0009
  593.             moveq    #0,d0
  594.             dc.w     $A82A
  595.         EndM
  596.     ELSE
  597.         IMPORT_CFM_FUNCTION    AudioSetTreble
  598.     ENDIF
  599.  
  600. ;
  601. ; pascal ComponentResult AudioGetOutputDevice(ComponentInstance ac, Component *outputDevice)
  602. ;
  603.     IF ¬ GENERATINGCFM THEN
  604.         Macro
  605.         _AudioGetOutputDevice
  606.             dc.w     $2F3C
  607.             dc.w     $0004
  608.             dc.w     $000A
  609.             moveq    #0,d0
  610.             dc.w     $A82A
  611.         EndM
  612.     ELSE
  613.         IMPORT_CFM_FUNCTION    AudioGetOutputDevice
  614.     ENDIF
  615.  
  616. ;This is routine is private to the AudioVision component.  It enables the watching of the mute key.
  617. ;
  618. ; pascal ComponentResult AudioMuteOnEvent(ComponentInstance ac, short muteOnEvent)
  619. ;
  620.     IF ¬ GENERATINGCFM THEN
  621.         Macro
  622.         _AudioMuteOnEvent
  623.             dc.w     $2F3C
  624.             dc.w     $0002
  625.             dc.w     $0081
  626.             moveq    #0,d0
  627.             dc.w     $A82A
  628.         EndM
  629.     ELSE
  630.         IMPORT_CFM_FUNCTION    AudioMuteOnEvent
  631.     ENDIF
  632.  
  633.     ENDIF ; __SOUNDCOMPONENTS__
  634.